package com.jastar.android.game.richman.logic.enums;

import com.jastar.android.game.richman.GameActivity;
import com.jastar.android.game.richman.logic.bean.Cell;
import com.jastar.android.game.richman.logic.bean.Player;
import com.jastar.android.game.richman.logic.handler.CellChanceHandler;
import com.jastar.android.game.richman.logic.handler.CellDefaultHandler;
import com.jastar.android.game.richman.logic.handler.CellDisasterHandler;
import com.jastar.android.game.richman.logic.handler.CellLandHandler;
import com.jastar.android.game.richman.logic.handler.CellShopHandler;
import com.jastar.android.game.richman.logic.handler.CellStartHandler;

public enum CellType {

    /** 起点 */
    START(0xFF88FF88, new CellStartHandler()),
    /** 地产 */
    LAND(0xFFAAAAAA, new CellLandHandler()),
    /** 机会 */
    CHANCE(0xFFFFFF88, new CellChanceHandler()),
    /** 灾难 */
    DISASTER(0xFF888888, new CellDisasterHandler()),
    /** 商店 */
    SHOP(0xFFFFAA88, new CellShopHandler()),
    /** 监狱 */
    JAIL(0xFFFF88FF, new CellDefaultHandler());

    private int color;
    private Handler handler;

    CellType(int color, Handler handler) {
        this.color = color;
        this.handler = handler;
    }

    public int getColor() {
        return color;
    }

    public Handler getHandler() {
        return handler;
    }

    public interface Handler {

        void hand(GameActivity activity, Cell cell, Player player, Callback callback);

    }

    public interface Callback {

        void callback();

    }

}